package org.lemon.cla.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.lemon.cla.enums.NewsCategoryEnum;
import org.lemon.cla.enums.UserRoleEnum;

import java.time.LocalDateTime;

@Data
@Schema(description = "新闻视图对象 (包含发布者信息)")
public class NewsVo {

    @Schema(description = "新闻ID", example = "1")
    private Long newsId;

    @Schema(description = "标题", example = "学校图书馆新增图书")
    private String title;

    @Schema(description = "封面URL", example = "http://example.com/cover.jpg")
    private String coverUrl;

    @Schema(description = "新闻内容", example = "详细新闻内容...")
    private String content;

    @Schema(description = "发布者ID", example = "101")
    private Long publisherId;

    // --- 发布者用户信息 ---
    @Schema(description = "发布者用户名", example = "admin_zhang")
    private String publisherUsername;

    @Schema(description = "发布者头像URL", example = "http://example.com/admin_avatar.jpg")
    private String publisherAvatarUrl;

    @Schema(description = "发布者真名", example = "张管理员")
    private String publisherRealName;

    @Schema(description = "发布者手机号", example = "13800138000")
    private String publisherPhone;

    @Schema(description = "发布者邮箱", example = "admin@example.com")
    private String publisherEmail;

    @Schema(description = "发布者角色", example = "管理员")
    private UserRoleEnum publisherRole;

    @Schema(description = "发布者是否已逻辑删除 (如果为true，则以上发布者信息应显示为'未知')", example = "false")
    private Boolean publisherIsDeleted; // 新增字段：发布者是否已逻辑删除

    @Schema(description = "发布时间", example = "2023-10-26T10:00:00")
    private LocalDateTime publishTime;

    @Schema(description = "新闻类别", example = "学术", allowableValues = {"学术", "事件", "通知"})
    private NewsCategoryEnum category;

    @Schema(description = "浏览次数", example = "1500")
    private Integer viewCount;
}